package com.tfswx.ruleengine.compute.gs;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

import java.util.ArrayList;
import java.util.List;

/**
 * @author ricky
 * @date 2021/5/23
 */
@Slf4j
public class GsUtil {
    private GsUtil() {
    }

    public static List<GsItem> getGsList() {
        List<GsItem> gsList = new ArrayList<>();
        GsItem gsItem = new GsItem("null", "为空", "p0 == ''", "n0等于空");
        gsList.add(gsItem);
        gsItem = new GsItem("notNull", "不为空", "p0 != ''", "n0不等于空");
        gsList.add(gsItem);
        gsItem = new GsItem("eq", "等于", "p0 == p1", "n0等于n1");
        gsList.add(gsItem);
        gsItem = new GsItem("ne", "不等于", "p0 != p1", "n0不等于n1");
        gsList.add(gsItem);
        gsItem = new GsItem("lt", "小于", "p0 < p1", "n0小于n1");
        gsList.add(gsItem);
        gsItem = new GsItem("gt", "大于", "p0 > p1", "n0大于n1");
        gsList.add(gsItem);
        gsItem = new GsItem("le", "小于等于", "p0 <= p1", "n0小于等于n1");
        gsList.add(gsItem);
        gsItem = new GsItem("ge", "大于等于", "p0 >= p1", "n0大于等于n1");
        gsList.add(gsItem);
        return gsList;
    }

    @Data
    @AllArgsConstructor
    public static class GsItem {
        private String type;
        private String label;
        private String format;
        private String nformat;
    }
}
